/*

	SceneManager.h
	
	Manager class for handling 3D scenes.
	Contains information about all objects
	in the current scene.
	
	Written by Sigurd Suhm 2009

*/

#ifndef _SCENEMANAGER_H
#define _SCENEMANAGER_H

// Includes
#include "Camera.h"			// Camera class header
#include "GameObject.h"		// Game object header
#include "Sprite.h"			// Sprite class header
#include "IDevice.h"		// Graphics device header

#include <vector>			// STL vector class header

using namespace std;

namespace EraAstral
{
	using namespace graphics;
	
	namespace graphics
	{
		// Light source interface prototype
		class ILightSource;
	}

	namespace core
	{
		// Scene manager class
		class SceneManager
		{
			private:
				// Graphics device
				IDevice		*m_device;			
			
				// Camera of the current scene
				Camera		*m_camera;
				// Vector containing all objects in the current scene
				vector<GameObject *> 	m_objects;
				// Vector containing active sprites
				vector<Sprite *>		m_sprites;
				// Lights in the current scene
				vector<ILightSource *>	m_lights;
				// Should lighting be used?
				bool	m_useLighting;
			
			public:
				// Default constructor
				SceneManager(IDevice *device);
				// Default destructor
				~SceneManager();
				
				// Adds an object to the scene manager
				void AddObject(GameObject *object);
				// Adds a sprite to the scene manager
				void AddSprite(Sprite *sprite);
				// Adds a alight source to the scene manager
				void AddLight(ILightSource *light);
				// Draws all objects
				void DrawAll();
				
				// Gets the camera of the scene
				Camera *GetCamera() const;
				// Gets a specific light from the current scene
				ILightSource	*GetLight(unsigned int index) const;
				// Gets the number of active lights in the scene
				unsigned int	GetLightCount() const;
				// Toggles lighting
				void		ToggleLighting();
		};
	}
}

#endif		// _SCENEMANAGER_H